home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: tails-reconfigure-kexec
- # Required-Start: $local_fs
- # Required-Stop:
- # Default-Start: 2 3 4 5
- # Default-Stop:
- # Short-Description: Reconfigure kexec depending on running kernel
- # Description: Reconfigure kexec depending on running kernel
- ### END INIT INFO
-
- PATH="/usr/local/bin:${PATH}"
- KEXEC_CONF=/etc/default/kexec
-
- case "$1" in
- start)
- KERNEL_IMAGE=$(tails-boot-to-kexec kernel $(tails-get-bootinfo kernel))
- INITRD=$(tails-boot-to-kexec initrd $(tails-get-bootinfo initrd))
- echo "KERNEL_IMAGE=\"${KERNEL_IMAGE}\"" >> "$KEXEC_CONF"
- echo "INITRD=\"${INITRD}\"" >> "$KEXEC_CONF"
- if grep -qw debug=wipemem /proc/cmdline; then
- echo 'APPEND="${APPEND} sdmemdebug=1"' >> "$KEXEC_CONF"
- else
- echo 'APPEND="${APPEND} quiet"' >> "$KEXEC_CONF"
- fi
- ;;
- *)
- echo "Usage: $0 start" >&2
- exit 3
- ;;
- esac
- exit 0
-